package org.theqcp.wow.sim.engine.revised.scripts;

import org.theqcp.wow.sim.engine.revised.enums.EnchantmentType;

public class EnchantmentFactory extends ScriptedEventObserverFactory<Enchantment> {

    private static EnchantmentFactory enchantFactory = null;

    public static Enchantment newObserver( EnchantmentType type ) throws ClassNotFoundException {
	if( enchantFactory == null ) {
	    enchantFactory = new EnchantmentFactory();
	}
	return enchantFactory.newEventObserver(type);
    }

    public static Enchantment newObserver( String type ) throws ClassNotFoundException {
	if( enchantFactory == null ) {
	    enchantFactory = new EnchantmentFactory();
	}
	return enchantFactory.newEventObserver(type);
    }

    private final String basePath = "res/enchants/";

    public Enchantment newEventObserver( EnchantmentType type ) throws ClassNotFoundException {
	return (Enchantment) super.newEventObserver(type, basePath);
    }

    public Enchantment newEventObserver( String type ) throws ClassNotFoundException {
	return (Enchantment) super.newEventObserver(type, basePath);
    }

}
